<?php

// +----------------------------------------------------------------------
// |  会员模型
// +----------------------------------------------------------------------

namespace Member\Model;

use Common\Model\Model;

class UserModel extends Model {



    public function userRegisters($username, $password) {
        //检查用户名

        $encrypt = genRandomString(6);
        $password = md5($password);
        $data = array(
            'uname'=>$username,
            "upassword" => $password,
            'authkey'=> $encrypt,
        );
        dump($data);
        $userid = $this->add($data);
        dump($userid);

        if ($userid) {
            return $userid;
        }
        $this->error = $this->getError()? : '注册失败！';
        return false;
    }






}
